package com.ruoyi.management.carservicestatics.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.management.carservicestatics.domain.TCarServiceCollect;
import com.ruoyi.management.carservicestatics.mapper.TCarServiceCollectMapper;
import com.ruoyi.management.carservicestatics.service.ITCarServiceCollectService;
import com.ruoyi.passenger.order.domain.TOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 车辆营运数据采集Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-10
 */
@Service
public class TCarServiceCollectServiceImpl implements ITCarServiceCollectService
{
    @Autowired
    private TCarServiceCollectMapper tCarServiceCollectMapper;

    /**
     * 查询车辆营运数据采集
     * 
     * @param id 车辆营运数据采集主键
     * @return 车辆营运数据采集
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public TCarServiceCollect selectTCarServiceCollectById(String id)
    {
        return tCarServiceCollectMapper.selectTCarServiceCollectById(id);
    }

    /**
     * 查询车辆营运数据采集列表
     * 
     * @param tCarServiceCollect 车辆营运数据采集
     * @return 车辆营运数据采集
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<TCarServiceCollect> selectTCarServiceCollectList(TCarServiceCollect tCarServiceCollect)
    {
        return tCarServiceCollectMapper.selectTCarServiceCollectList(tCarServiceCollect);
    }

    /**
     * 新增车辆营运数据采集
     * 
     * @param tCarServiceCollect 车辆营运数据采集
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertTCarServiceCollect(TCarServiceCollect tCarServiceCollect)
    {
        tCarServiceCollect.setCreateTime(DateUtils.getNowDate());
        return tCarServiceCollectMapper.insertTCarServiceCollect(tCarServiceCollect);
    }

    /**
     * 修改车辆营运数据采集
     * 
     * @param tCarServiceCollect 车辆营运数据采集
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateTCarServiceCollect(TCarServiceCollect tCarServiceCollect)
    {
        tCarServiceCollect.setUpdateTime(DateUtils.getNowDate());
        return tCarServiceCollectMapper.updateTCarServiceCollect(tCarServiceCollect);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateTCarServiceCollectList(List<String> list) {
        return tCarServiceCollectMapper.updateTCarServiceCollectList(list);
    }

    /**
     * 批量删除车辆营运数据采集
     * 
     * @param ids 需要删除的车辆营运数据采集主键
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteTCarServiceCollectByIds(String[] ids)
    {
        return tCarServiceCollectMapper.deleteTCarServiceCollectByIds(ids);
    }

    /**
     * 删除车辆营运数据采集信息
     * 
     * @param id 车辆营运数据采集主键
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteTCarServiceCollectById(String id)
    {
        return tCarServiceCollectMapper.deleteTCarServiceCollectById(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public TCarServiceCollect getCarServiceCollectByOrder(TOrder order) {
        return tCarServiceCollectMapper.selectCarServiceCollectByOrder(order);
    }
}
